Method for displaying editable characters in a divided table cell

ABSTRACT

A divided table cell is generated by selecting one cell in a table and creating a new cell to display over the selected cell. Both cells contain a constraint that define an area where that cell cannot display objects. Objects comprise alphanumeric characters, graphical symbols or any representation in a table cell. The cells are displayed over top of each other such that the display area of one cell coincides with the constraint area of the other cell. The display shows a divided cell capable of accepting and editing objects. The divided cell also retains the characteristics of other cells in the table. The object layout in a cell with a constraint utilizes test rectangles to calculate the height and width of the displayable area of the cell. An initial test rectangle is calculated using the full width of the cell and the height of the objects to be placed in it. The initial test rectangle is then modified by applying the constraint to the initial test rectangle and removing all the sections, preferably rectangular sections, of the initial test rectangle that intersect the constraint. The resulting objects that fit in the modified test rectangle are presented in the display.

FIELD OF THE INVENTION

[0001] The field of the invention relates to the display of objects,particularly linguistic and other communicative symbols, in a tablecell, and specifically, to display objects, capable of being edited, ina divided table cell.

BACKGROUND OF THE INVENTION

[0002] Tables are used extensively in today's computing environment. Theuses of tables include organizing topics under categories, creatingfinancial reports, organizing employee records, as well as many otherways where it is desirable to manage or represent related data. Becauseof the many uses of tables, word processing, spreadsheet, database, anddesktop publishing applications have all provided functional support forthe use of tables.

[0003] As the use of tables proliferate, the demands for moresophisticated table support in the applications while making them easierto use has increased. Examples of these increased demands includesimpler table creation and manipulation, the display of borders aroundthe table and the individual cells within the table and providingcalculation functions on the cells within the table. These increaseddemands are present for tables wherever they are found: in wordprocessing, spreadsheet, database, and desktop publishing applications.Effective presentation of data is the goal.

[0004] One demand that has risen is to create a divided cell in a table.For example, diagonally divided cells are most commonly used in a tableto block off specific cells of the table signifying that no entries mayexist for that cell. However, other needs for divided cells also exist.These needs include incorporating objects in a divided cell. Objectscomprise linguistic and other communicative symbols, includingalphanumeric characters, graphic symbols, or any representation in atable cell. FIGS. 1a and 1 b illustrate two examples of other uses of adivided cell. FIG. 1a illustrates a calendar wherein the divided cell 3,in this case a diagonally divided cell, is used to represent two days ofthe month within a single cell. FIG. 1b illustrates a table with row andcolumn headings wherein the divided cell 7, also a diagonally dividedcell, depicts category headings for the table's rows and columns. Notethat in both of these examples, text objects are displayed on both sidesof the diagonal. Having text objects on both sides creates a need suchthat the user can enter text on both sides as well as edit the existingtext on both sides of the diagonal.

[0005] To address this need, one existing implementation includesdrawing a line to divide the cell diagonally in either direction (i.e.,from the Northwest corner of the cell to the Southeast, or from theNortheast corner to the Southwest) as well as drawing an “X” over thecell. However, in this implementation, the drawing of the diagonal linerenders the cell uneditable. This drawback also creates an inconsistencyfrom a user interface standpoint. The cell with a diagonal drawingcreates an inconsistency because it is an anomaly within the table.Unlike the other cells in the table, no data may be placed in the celland it is uneditable.

[0006] Other implementations that attempt to get around thisuneditability of a divided cell with a diagonal include creating aseparate text object that floats above the diagonal cell on the display.However, in this implementation, the text object is distinct from thetable structure providing unwanted side effects. For example, wheneverthe table cell is resized or the format of the cell is changed, aseparate editing step is required to modify the “floated” text object sothat it conforms with the rest of the table.

[0007] And yet another implementation includes restricting the text to afixed-pitch grid and drawing lines through the breaks in the letters.However, this also requires multiple editing steps when parameters ofthe cell are changed. In addition, this solution does not work when thefont in the text is one of the commonly used proportional spaced fonts.

[0008] Accordingly, there is a need in the art to generate a dividedcell, which provides editing on both sides of the division and minimizesthe steps required when editing objects in the cell and manipulating theparameters of the cell.

SUMMARY OF THE INVENTION

[0009] The present invention meets the needs described above byproviding a method for generating a divided cell and displaying objectsin the divided cell in such a manner as to allow for efficient editingof the objects. Objects comprise alphanumeric characters, graphicsymbols or any representation in a table cell. For purposes ofdiscussion, however, the present invention is described in terms ofcharacters in a cell, but will apply to any object that may be placed ina cell.

[0010] A divided cell is generated by creating a new cell and displayingthe new cell on top of a cell in the display. Each cell containsconstraints. Characters contained in each cell are laid out such that nocharacter in each cell is displayed in an area defined by a constraint.

[0011] The divided cell is generated by first selecting a cell in thetable. The divided cell will be displayed at this cell location. Themethod of selecting the cell can be any method recognized by theapplication, including navigating to the cell using a keyboard entrydevice or clicking on the cell with a mouse input device. After the cellis selected, a new cell is generated. The new cell is structurally andfunctionally similar to the existing cell. The new cell is created usingwhatever cell creation mechanism is supported by the table and theapplication.

[0012] After the new cell is created, constraints are developed for eachof the cells. Characteristics of the constraints include: 1) theconstraint for the cell prevents any of the characters contained in thatcell from being displayed in the area defined by the constraint; and 2)the constraint area defined for one cell contains the displayable areafor the other cell. After generating the constraints for both cells, anycharacters that are currently contained in both cells or that areentered into the cells are arranged such that they do not intersect anyof the area defined by the constraints in the respective cells.

[0013] After the object layout is completed, the new cell is displayedover the existing cell along with a divider. The display now contains adivided cell, made up of two cells and a divider. Each cell in thedivided cell will function like any other cell in the table. Each cellcan be formatted, edited independently or collectively, in the samemanner as any other cell in the table. This editing can be performed byselecting the side of the divided cell the user desires to edit. Theuser selects the desired side of the divided cell by either 1) clickingon the side of the divided cell the user wishes to edit or reformatusing a mouse input device or 2) navigating to the desired side of thedivided cell using arrow and/or tab keys on a keyboard input device.

[0014] The display address of the two cells that make up the dividedcell is the same because it occupies the same location in the display.However, to distinguish between the two cells, additional parameters arestored with each cell to keep them distinct. These parameters includewhether the cell is part of a divided cell, how the cell is divided, andwhich part of the division constitutes the displayable area for thatcell.

[0015] When either of the cells that make up the divided cell is edited,the constraint is recalculated, if necessary. Then the cell that isedited reapplies the constraint and modifies the display based on theedited characters.

[0016] To perform the object layout in the cell with a constraint, afirst test rectangle is defined. The test rectangle has a width that isthe width of the cell and a height that is based on the height of thetallest character from the set of characters that fit within the widthof the first test rectangle. The test rectangle represents a line in thecell that will contain characters. The constraint in the cell is thenapplied to the first test rectangle. The section of the first testrectangle that intersects the area of the cell constraint is removed. Itis preferable that the removed section be rectangular. The removal ofthe section intersecting the constraint modifies the width of the firsttest rectangle. A second test rectangle is generated to reflect thewidth of the modified first test rectangle while using the height of thefirst test rectangle.

[0017] If a height based on the tallest character from the set ofcharacters that fit within the width of the second test rectangle isless than the height of the first test rectangle, then the another setof test rectangles may be calculated to provide a more proportionalmatch between the height space allocation in the cell with the height ofthe character set of that fits within the width of the test rectangle.

[0018] After determining the final height and width of a test rectangle,the characters that fit into the width of this test rectangle aredisplayed on a line of the cell within the area defined by the finaltest rectangle. The object layout procedure is reiterated for as manylines in the cell as necessary to display the characters until all thecharacters are displayed or the procedure runs out of display area. Inthe case where the procedure runs out of display area, characters thatdo not fit into the display area remain in an overflow buffer and arenot visible in the diagonal cell.

[0019] It should be recognized that text in a table is not always drawnhorizontally, left to right. For example, Chinese vertical text is drawnvertically right to left, and bidirectional Hebrew or Arabic text isdrawn horizontally, sometimes left to right, sometimes right to left.While the description of the present invention focuses on objectsdisplayed horizontally, it is also considered within the scope of thepresent invention to display objects that are not typically displayedhorizontally, left to right (i.e., vertical Chinese text orbidirectional Hebrew or Arabic text). It is further considered withinthe scope to display objects in the diagonal cell using differentdisplay schemes, such as displaying horizontal text in one side of thediagonal cell and displaying vertical text in the other side.

[0020] In addition, those skilled in the art will also recognize thatthe vertical position of the first line space is an arbitrary decision.This decision can be made to suit the needs of table display featuressuch as centering or bottoming the location of text in a cell, or“lefting” or “righting” vertical text in a cell.

BRIEF DESCRIPTION OF THE DRAWINGS

[0021]FIGS. 1a and 1 b are diagrams illustrating how divided cells areused in tables.

[0022]FIG. 2 is a block diagram of a personal computer illustrating theoperating environment of an embodiment of the invention.

[0023]FIGS. 3a and 3 b are diagrams illustrating how a new cell overlaysan existing cell within a table to create a diagonal cell in anembodiment of the invention.

[0024]FIGS. 4a and 4 b are diagrams illustrating the object layoutfeature within the cells that create the diagonal cell along with theirrespective constraints in an embodiment of the invention.

[0025]FIG. 5 is a flowchart illustrating the steps for generating aneditable diagonal table cell in an embodiment of the invention.

[0026]FIG. 6a-6 f are diagrams graphically depicting how characters aredisplayed in a table cell that includes a constraint in an embodiment ofthe invention.

[0027]FIG. 7 is a flowchart depicting the steps for displayingcharacters in a table cell that includes a constraint in an embodimentof the invention.

DETAILED DESCRIPTION

[0028] The present invention is directed toward a method for displayingeditable characters in a divided table cell. In one embodiment, theinvention may be incorporated into a desktop publishing applicationprogram, such as the application entitled “Publisher”, marketed byMicrosoft Corporation of Redmond, Wash. Briefly described, the method ofgenerating a divided table cell includes the user selecting a table cellto be divided. Next the user defines how to divide the table cell. A newcell is then created with display constraints. The constraints aredeveloped based on how the table cell is divided. The constraints definein which area of the cell characters cannot be displayed. For example,in a diagonal cell, a constraint will be a triangular shape formed bytwo adjacent edges of the cell and the diagonal line that joins the twofree ends of the adjacent edges. The initial cell and the new cell mayhave different constraints so that when they are displayed on top ofeach other, the characters located in each of the cells do not overwriteeach other. The object layout is then performed by incorporating theconstraint in each cell to display the characters in each cell such thatthey do not overlap the constraint.

[0029] The object layout in each cell is performed by first defining atest rectangle in the cell, the test rectangle defines a line of thecell to display characters. The width of the test rectangle is the fullwidth of the cell, and the height of the test rectangle is based on theheight of the tallest character that would be displayed in the testrectangle. A constraint is then applied to the test rectangle. Theconstraint defines an area where characters may not be displayed.Sections of the test rectangle that intersect the constraint are removedcreating a new test rectangle. It is preferable that the removedsections be rectangular. If a height based on the tallest character fromthe set of characters that fit within the width of the new testrectangle is less than the height based on the tallest character fromthe set of characters that fit within the width of the initial textrectangle, another test rectangle may be calculated to modify the heightof the new test rectangle. The characters that fit the final testrectangle are then displayed in the cell.

[0030] Exemplary Operating Environment

[0031]FIG. 2 and the following discussion are intended to provide abrief, general description of a suitable computing environment in whichthe invention may be implemented. While the invention will be describedin the general context of an application program that runs on anoperating system in conjunction with a personal computer, those skilledin the art will recognize that the invention also may be implemented incombination with other program modules. Generally, program modulesinclude routines, programs, components, data structures, etc. thatperform particular tasks or implement particular abstract data types.Moreover, those skilled in the art will appreciate that the inventionmay be practiced with other computer system configurations, includinghand-held devices, multiprocessor systems, microprocessor-based orprogrammable consumer electronics, minicomputers, mainframe computers,and the like. The invention may also be practiced in distributedcomputing environments where tasks are performed by remote processingdevices that are linked through a communications network. In adistributed computing environment, program modules may be located inboth local and remote memory storage devices.

[0032] With reference to FIG. 2, an exemplary system for implementingthe invention includes a conventional personal computer 20, including aprocessing unit 21, a system memory 22, and a system bus 23 that couplesthe system memory to the processing unit 21. The system memory 22includes read only memory (ROM) 24 and random access memory (RAM) 25. Abasic input/output system 26 (BIOS), containing the basic routines thathelp to transfer information between elements within the personalcomputer 20, such as during start-up, is stored in ROM 24. The personalcomputer 20 further includes a hard disk drive 27, a magnetic disk drive28, e.g., to read from or write to a removable disk 29, and an opticaldisk drive 30, e.g., for reading a CD-ROM disk 31 or to read from orwrite to other optical media. The hard disk drive 27, magnetic diskdrive 28, and optical disk drive 30 are connected to the system bus 23by a hard disk drive interface 32, a magnetic disk drive interface 33,and an optical drive interface 34, respectively. The drives and theirassociated computer-readable media provide nonvolatile storage for thepersonal computer 20. Although the description of computer-readablemedia above refers to a hard disk, a removable magnetic disk and aCD-ROM disk, it should be appreciated by those skilled in the art thatother types of media which are readable by a computer, such as magneticcassettes, flash memory cards, digital video disks, Bernoullicartridges, and the like, may also be used in the exemplary operatingenvironment.

[0033] A number of program modules may be stored in the drives and RAM25, including an operating system 35, one or more application programs36, other program modules 37, and program data 38. A user may entercommands and information into the personal computer 20 through akeyboard 40 and pointing device, such as a mouse 42. Other input devices(not shown) may include a microphone, joystick, game pad, satellitedish, scanner, or the like. These and other input devices are oftenconnected to the processing unit 21 through a serial port interface 46that is coupled to the system bus, but may be connected by otherinterfaces, such as a game port or a universal serial bus (USB). Amonitor 47 or other type of display device is also connected to thesystem bus 23 via an interface, such as a video adapter 48. In additionto the monitor, personal computers typically include other peripheraloutput devices (not shown), such as speakers or printers.

[0034] The personal computer 20 may operate in a networked environmentusing logical connections to one or more remote computers, such as aremote computer 49. The remote computer 49 may be a server, a router, apeer device or other common network node, and typically includes many orall of the elements described relative to the personal computer 20,although only a memory storage device 50 has been illustrated in FIG. 2.The logical connections depicted in FIG. 2 include a local area network(LAN) 51 and a wide area network (WAN) 52. Such networking environmentsare commonplace in offices, enterprise-wide computer networks,intranets, and the Internet.

[0035] When used in a LAN networking environment, the personal computer20 is connected to the LAN 51 through a network interface 53. When usedin a WAN networking environment, the personal computer 20 typicallyincludes a modem 54 or other means for establishing communications overthe WAN 52, such as the Internet. The modem 54, which may be internal orexternal, is connected to the system bus 23 via the serial portinterface 46. In a networked environment, program modules depictedrelative to the personal computer 20, or portions thereof, may be storedin the remote memory storage device. It will be appreciated that thenetwork connections shown are exemplary and other means of establishinga communications link between the computers may be used.

[0036]FIGS. 3a and 3 b depict how the structure of a table is modifiedwhen a new cell is created to generate a divided table cell in oneembodiment of the present invention. The table shown in FIGS. 3a and 3 bis made up of cells. Each cell may contain objects, which includealphanumeric characters, graphical symbols or any representation in atable cell. As stated above, however, for purposes of discussion, thepresent invention is described in terms of characters in a cell. Yet, itshould be recognized that the present invention also applies to anyobject that may be placed in a cell.

[0037] Generally, the table contains an RxC number of cells. The “R”representing the number of rows in the table and the “C” representingthe number of columns in the table. The table may also include titlebars, legends, and other components (not shown) to help depict theinformation in the table. The table in FIG. 3a is a 2×2 table havingfour cells (cell 0 305 through cell 3 320). In one embodiment of thepresent invention, a new cell is created and overlaid on an existingcell to produce a divided cell. FIG. 3b illustrates how this embodimentof the present invention overlays a newly created cell over an existingcell. In FIG. 3b, the divided cell 325 actually constitutes twoindependent cells, cell 0 and cell 4. The independent cells aredisplayed on top of each other to create a divided table cell. The newcell 4 in the divided cell 325 is not a separate object outside of thetable but is actually a cell defined in the table. Valid tableoperations that can be performed on the cells of the table can also beperformed on the new cell 4.

[0038]FIGS. 4a and 4 b illustrate how characters are displayed in thetwo overlaid cells, cell 8 402 and cell 9 412, of the divided cell inone embodiment of the invention. Normally, characters are displayed inthe cell to fill the entire width of the cell using as many lines aspossible to fill the cell completely. In one embodiment of the presentinvention, the divided cell is defined to be a diagonal cell. In thisembodiment, two triangular constraints 405 and 415 are generated foreach diagonal cell (i.e., a triangular constraint is generated for eachcell that make up the diagonal cell). These constraints define the areaof the cell that includes the display area for the other cell. Forexample, the triangular constraint 405 in cell 8 402 is the samerelative area in the diagonal cell where the characters in cell 9 412are displayed in the diagonal cell. And vice versa, the triangularconstraint 415 of cell 9 412 includes the same relative area in thediagonal cell where the characters of cell 8 402 are displayed in thediagonal cell. Within the cell, the constraint area defines the area ofthe cell in which characters cannot be displayed. This allows thecharacters of both cells to be visible and unobstructed when they aredisplayed over top of each other.

[0039] In the case of diagonal cells, the two cells that define thediagonal cell only have characters displayed in the unconstrained areas410 for cell 8 and 420 for cell 9. Cell 8 has a triangular constraint405 that prevents any characters contained in cell 8 from beingdisplayed in the triangular constraint 405. Similarly, cell 9 has anopposing triangular constraint 415 that prevents any characterscontained in cell 9 from being displayed in the triangular constraint415.

[0040] Note that the characters contained in the cells that make up thediagonal cell are independent of each other. In one embodiment, anycharacters that are in cell 8 upon the creation of cell 9 remain in cell8. The possibility exists, however, that when cell 9 is created, thecharacters that are in cell 8 are copied and displayed in cell 9 aswell. Another alternative is to divide the original characters, e.g.those in cell 8, into two bodies, according to the presence of breakcharacters, such as end-of-paragraph marks. This is a design choice leftto those implementing the invention.

[0041] One skilled in the art will recognize that the triangularconstraint need not extend from one corner of the cell to the other. Theconstraint can be defined as any portion of the cell. Furthermore, theconstraints need not be triangular. A cell division that creates tworectangles versus a diagonal cell may be preferred. In such a case, theconstraints would be designed to define two rectangular areas of thecell.

[0042]FIG. 5 is a flowchart that shows the steps for generating aneditable diagonal table cell in one embodiment of the present invention.The method 500 begins at the start step 505. In this embodiment, anapplication program has already been executed and a table has alreadybeen defined in the application program. The cells in the table mayalready contain characters or they may not. The method 500 proceeds tostep 510 where the user selects a cell to be divided. Typically, a userperforms the cell selection, but selection can be done by theapplication or by other automated means. Where the user executes thecell selection, the selection can be performed by using a mouse toselect the individual cell or by navigating to the cell address using akeyboard input device. Although this embodiment performs the selectionof one cell, it should be recognized by those skilled in art thatseveral cells may be selected if more than one diagonal cell is desired.In the case where more than one cell is selected, the number of cellscreated at step 520 will equal the number of cells selected. In analternative implementation, a selection of more than one cell can beautomatically merged into a single cell, and then divided.

[0043] The method 500 then proceeds to step 515 where the diagonaldirection is selected. In one embodiment, there are two diagonaldirections in which to divide a cell. The diagonal may divides the cellfrom the Northwest corner to the Southeast corner of the cell or fromthe Northeast corner to the Southwest corner. Consequently, in step 515,the selection of which direction to make the diagonal is performed.Where the selection is performed by the user, it may be performedthrough the use of a dialogue box presented to the user. The user isgiven the option to select one of the two diagonals, and the userselects one through the use of a mouse input device or keyboard.

[0044] As stated above, it should be recognized that a cell may bedivided in many ways. For example, different ways to divide a cellinclude vertically across the middle of the cell, horizontally acrossthe middle of the cell or even a stair-step diagonal. Similarly, itshould be recognized by one skilled in the art that several differentforms may be simultaneously supported. Having several differentdivisions may necessitate additional selection criteria where the useris asked to select which division he or she wishes to apply in additionto the selection of the direction of the division (e.g., diagonal) asmentioned with respect to step 515.

[0045] After the diagonal direction has been selected, the method 500continues by creating a new cell in step 520. The new cell is createdusing whatever routine the current application and table support ingenerating a new cell. In one embodiment, the new cell initially startswith the same formatting characteristics as the selected cell. However,once created, the new cell may be formatted independently of theselected cell or any other cell in the table. In addition, because thecell is a structure of the table and not a completely independentobject, the new cell will respond to any executed table operations thatcan be performed on other cells in the table. These operations includeresizing, reformatting, and editing.

[0046] The method 500 then proceeds to step 525 where a triangularconstraint is generated for the new cell as well as the selected cell.In one embodiment, a triangular constraint is defined as an array of 3points, each point corresponding to a vertex of the triangularconstraint. Both cells receive a different array defining theirrespective triangular constraint. The selected cell receives an array ofpoints defining a triangular constraint which defines the triangulararea bounded by two adjacent sides and the selected diagonal direction.In the case where a Northwest/Southeast diagonal direction is selected,the array of points define a triangular area located in the lowerleft-hand portion of the cell (e.g., see triangular constraint 405 inFIG. 4a). The triangular area is formed using the bottom and left-handadjacent edges of the cell and the diagonal. In the same instance wherea Northwest/Southeast diagonal direction is selected, the array ofpoints for the new cell define an opposing triangular constraint to theselected cells triangular constraint. This opposing triangularconstraint is defined by the upper right-hand triangle made up of thetwo upper and the right-hand adjacent sides of the cell and thediagonal.

[0047] It will be recognized by those skilled in the art that there aremany ways to define the shape of the constraint in a cell. Any number ofpoints and/or functions may be used to generate any number of geometricshapes that can act as a constraint area.

[0048] The method 500 then continues to place characters in both cellsincorporating their respective triangular constraints in step 530.Normally, without a constraint, characters are displayed in the cellusing the full height and width of the cell. However, the constraintdefines an area of the cell where characters cannot be displayed. Anycharacters that were in the cell prior to the application of theconstraint are now rearranged to avoid the constraint.

[0049] Therefore, in step 530, after the triangular constraint isapplied to the selected cell, the characters that existed in theselected cell are rearranged in the selected cell taking into accountthe triangular constraint defined for the selected cell. Similarly, anycharacters that are placed in the new cell are now arranged in the newcell taking into account the opposing triangular constraint.

[0050] Proceeding to step 535, the method 500 continues to display thenew cell over the selected cell, along with a diagonal, creating thediagonal cell. What is presented on the display in the area previouslyoccupied by just the selected cell, is information contained within twocells separated by a diagonal. The diagonal line may or may not bevisible on the display. Each of the cells contains a constraintpreventing the characters in one cell from using a portion of that cell,the constrained portion representing the displayable area of the othercell and the diagonal. In addition, the constraint for each cell alsotakes into account the varying border thickness that can be applied tothe diagonal. When the cells are displayed on top of each other, none ofthe characters in either cell overlap.

[0051] Continuing to step 540, the method 500 continues by rearrangingthe selected cell or new cell when any of the characters are edited.Because the diagonal cell comprises two cells, the characters displayedin the diagonal cell are editable just as any other cell in the table.After any edits are performed, the characters in the cell being editedare again rearranged using the applicable constraint. For example, ifthe edits are performed on characters contained in the new cell, theedited characters will be rearranged in the new cell such that they donot overlap the opposing triangular constraint. This rearranging ofcharacters can be performed by recalculating the constraint for eachedit or by caching the constraint thereby not requiring a recalculationof the constraint every time the text is edited. Either way, thediagonal cell now depicts the rearranged characters.

[0052] Therefore, in one embodiment, when the upper right-hand portionof the cell is edited, the modified characters in the selected cell arerearranged and bounded by the triangular constraint so that the modifiedcharacters are only displayed in the upper right-hand portion of thediagonal. When the lower left-hand portion of the display is edited, themodified characters in the new cell are rearranged and bounded by theopposing triangular constraint so that they are only displayed in thelower left-hand portion of the diagonal.

[0053] It will be recognized by one skilled in the art that arearrangement also occurs when functions, other than editing, areperformed on the cell that effect the object layout. For example, if thediagonal cell, or the table row, or column containing the diagonal cell,is resized to be made smaller, the displayable area has changed. In thiscase, new constraints are generated based on the new size of thediagonal cell, the triangular constraint is reapplied to the selectedcell and the opposing triangular constraint is reapplied to the newcell. The characters displayed in the selected cell and new cell, andtherefore the diagonal cell as well, are modified based on theapplication of the new constraints.

[0054] The method 500 then ends at step 545.

[0055] Now referring to FIGS. 6a-6 f, an object layout procedure in acell that contains a constraint in an embodiment of the invention isdepicted. FIG. 6a illustrates a cell 605 in a table. Specifically, cell605 comprises the displayable area 610 of the cell, the constraint 615,a linespace 612 (the vertical position in the cell where the nextplacement of characters will begin), a test rectangle 620, andcharacters “This is text IN A CELL” 630. The height “h1” 625 of the testrectangle 620 is based on the tallest character from the set ofcharacters that fit within the width of the test rectangle. In thiscase, the height “h1” is based on the height of the characters in thewords “IN A CELL”. FIG. 6a also shows that if no constraint 615 existed,the characters 630 would completely fit within the full cell width.

[0056] When the constraint 615 is applied to cell 605 and to the testrectangle 620 (FIG. 6a), a new test rectangle 635 (FIG. 6b) is generatedby removing the sections of the previous test rectangle 620 thatintersected the constraint 615. It is preferable that sections areremoved only as rectangles of the same height as the previous rectangle,to prevent aesthetically poor display of characters in a non-rectangularline space overlapped by the constraint. Note in FIG. 6b that only asubset of the characters that fit within test rectangle 620 (FIG. 6a)fit into the new test rectangle 635. The height “h1” 625 of the new testrectangle has not changed, although the character set that is containedin the test rectangle has. In this case, the characters “This is text”633 are much smaller in height than the new test rectangle's height “h1”625. Because of this size differential, it is preferable to reduce theheight of the test rectangle to provide a more proportional verticalspacing.

[0057] In FIG. 6c, another test rectangle 640 is generated, taking intoaccount the height “h2” 645 of the tallest character in the set ofcharacters 633 that fit within the width of the test rectangle 635 (FIG.6b). The width of the test rectangle 640 is determined to be the fullwidth of the cell 605.

[0058]FIG. 6d shows yet another test rectangle 650 generated by applyingthe constraint 615 to the test rectangle 640 (FIG. 6c). This testrectangle 650 is similar to the test rectangle 635 (FIG. 6b). Becausethe height of this test rectangle 650 is smaller than the height of thetest rectangle 635, the possibility exists that the width of this testrectangle 650 could be longer. This possibility is dependent on how theconstraint intersects the test rectangle.

[0059] After displaying the characters “This is text” 633 (FIG. 6d), thelinespace 612 is advanced to the next linespace 614 in the cell. Becausethe height of the test rectangle 635 was modified due to the heightdifferential in the initial character set 630, the linespace 614 is onlyadvanced the distance of “h2” 645 instead of the distance of “h1” 625.Changing the distance the linespace is advanced provides a more visuallynatural and proportional separation between the lines of characters.

[0060]FIG. 6e shows how the remaining characters “IN A CELL” 660 areplaced in a test rectangle 665 where the process begins again. FIG. 6fshows the result of how the characters 633 and 660 will be displayed inthe cell when the constraint is applied.

[0061] It will be recognized that FIGS. 6a-6 b illustrate thecalculations used in performing the cell layout. It is not intended toshow that all the items are actually displayed during the cell layout.In fact, it is preferable to perform the test rectangle calculations andthe constraint calculations in memory. Determining how the charactersfit into the test rectangle and the layout of the linespaces within thecell should be performed in memory prior to displaying the results inthe cell to maximize efficiency.

[0062] Referring now to FIG. 7, a flowchart illustrating a method 700for displaying characters in a table cell, which includes a constraint,in an embodiment of the invention is presented. The method 700 begins atthe START step 705. At step 705, a table has already been defined by theapplication program. In addition, a cell in the table either containsobjects or objects are being entered into the cell. The cell also has aconstraint associated with it. This constraint defines an area where nocharacters may be displayed in the cell.

[0063] As stated earlier, objects comprise alphanumeric characters,graphic symbols or any representation in a table cell. Although forpurposes of discussion, characters will be used to describe theinvention, the invention also applies to any object.

[0064] The method 700 continues to step 707 where a linespace in thecell is selected. The linespace is the vertical position on the cellwhere the next placement of characters will begin. For example, thelinespace may start at the top left-hand corner, and the characters areplaced in the cell beginning at that spot until no more characters fitwithin the width of the cell. The linespace then advances to the nextline, based on the height of the characters displayed, and representswhere the next set of characters are displayed.

[0065] After selecting the linespace, a test rectangle A is generated instep 710. The test rectangle A has the full width of the cell and aheight based on the tallest character from the set of characters thatfit within the width of the test rectangle. Generally, a test rectanglerepresents a displayable line of the cell that contains characters. Atest rectangle is a formatting aid used to arrange characters in a lineof a cell before displaying the characters in the cell. A test rectanglehas a certain height and width depending on the cell's width and theheight of the characters that are placed in it. After determining howmany characters fit within the test rectangle, those characters areplaced in the linespace of the cell.

[0066] To determine the height of test rectangle A, the width isdefaulted to be the full width of the cell. The height of the testrectangle A is determined by taking into account the height of thetallest character from the set of characters that fit within the widthof test rectangle A. At the completion of step 710, a height and widthof test rectangle A and number of characters that fit in test rectangleA are known.

[0067] After generating the test rectangle A in step 710, the method 700proceeds to step 715 where a new test rectangle B is generated thattakes into account the constraint in the cell. A constraint in the cellmay be at different locations at different linespaces in the cell. Forexample, in a cell with a Northwest/Southeast diagonal, the diagonalconstraint at the top of the cell intersects most of the line startingvery close to the left-hand side. Yet, at linespaces near the bottom ofthe Northwest/Southeast diagonal only a little of the cell's lineintersects the constraint, i.e., close to the right-hand side of thecell. Because the test rectangle A is a representation of the linebeginning at a linespace in the cell, where the constraint intersectsthe line will be the same as where the constraint intersects the testrectangle A.

[0068] Therefore in step 715, the constraint is applied to the testrectangle A to determine where the constraint intersects the testrectangle A and consequently, where the constraint intersects the lineat the current linespace in the cell. It is desirable to remove the areaof test rectangle A that intersects the constraint. And again, it ispreferable that the removed area be rectangular. To perform this, thetest rectangle A is divided into subsections. Each subsection thatintersects the constraint is removed from the test rectangle A. Theresult is a test rectangle B that may be narrower than test rectangle A.It will be recognized by one skilled in the art that the narrower thesubsections are defined, the greater the probability that the testrectangle B will be at the maximum width without overlapping theconstraint.

[0069] At step 720, the method 700 then calculates the height of testrectangle B based on the height of the tallest character from the set ofcharacters that fit within the width of test rectangle B. Test rectangleB may have a different width then test rectangle A. Because of thedifferent width, it is possible that a fewer number of characters, i.e.,a smaller character set, fit in test rectangle B than in test rectangleA. And because of the possibility of a smaller character set, the heightof the tallest character in the smaller character set may be differentfrom the height of the tallest character in the character set used fortest rectangle A. For example, in the instance where a cell has adiagonal constraint and the test rectangle A represents a line locatedin the middle, vertically, of the cell, approximately half of the testrectangle A is removed to generate test rectangle B because of theconstraint (see FIG. 6b). It is possible that the characters that wouldhave occupied the part of the test rectangle A that was removed were ofgreater height than those that occupy test rectangle B. In this case atstep 720, the height of the test rectangle B can be reduced to provide acloser fit to the characters. Furthermore, at a different height, thearea where the test rectangle intersects the constraint can differ,thereby requiring that fewer sections of the test rectangle be removed.This, in effect, increases the width of the test rectangle B.

[0070] It is possible to display the characters using the initial heightof test rectangle B. However, this may allocate too much vertical spacein the cell for the characters in test rectangle B giving an unnaturalvisual proportion of size of characters compared to the vertical spacebetween the lines in the cell (see FIG. 6b). Also, changing the formatof the characters could affect the layout of the preceding lines, whichis undesirable.

[0071] To address these effects, the height calculated based on thetallest character from the set of characters that fit within the widthof test rectangle B is compared to the height of test rectangle A instep 725.

[0072] If the calculated height based on the tallest character that fitsinto test rectangle B is less than the height of the test rectangle A,then additional formatting needs to be performed, and the method 700proceeds to step 730. However, if the calculated height based on thetallest character that fits into test rectangle B is equal to the heightof the test rectangle A, then the height of test rectangle B should notbe modified, and the method 700 proceeds to step 755.

[0073] In the case where the calculated height based on the tallestcharacter that fits into test rectangle B is less than the height oftest rectangle A, the method 700 proceeds at step 730 to calculate a newheight and width of another test rectangle to provide a better fit ofcharacters in the cell line at the linespace. Test rectangle C is formedusing the entire width of the cell and the height based on the tallestcharacter that fits into test rectangle B.

[0074] Proceeding to step 735, test rectangle D is then generated byapplying the constraint to test rectangle C. Test rectangle D isgenerated by removing the sections of test rectangle C that intersectthe constraint. Because the height of the test rectangle C is smallerthan the height of the test rectangle A, i.e., it is formed because thesmaller character height in test rectangle B, it is possible that fewersections of the test rectangle C need to be removed to generate testrectangle D than was required to be removed from test rectangle A toform test rectangle B. Hence, because fewer sections may be removed,test rectangle D may have a greater width than test rectangle B. Also,because of test rectangle D's potentially greater width, more charactersmay be able to be placed in test rectangle D than in test rectangle B.Having more characters placed in the test rectangle (and eventually inthe linespace) and having the height of the test rectangle (the verticalarea in the linespace allocated to the characters) more in proportion tothe characters displayed in the linespace provides three benefits.First, it allows more characters to be displayed in the cell, therebyproviding more efficient use of the space in the cell. Second, itprovides a more pleasing visual image where the vertical spacing usedfor characters is more in proportion with the size of the characters.And third, it ensures that when characters are formatted, the layout ofthe text preceding those characters are not affected, which could bevery disorienting to a user editing the document if allowed to occur.

[0075] After test rectangle D is calculated, a height based on thetallest character that fits into test rectangle D is determine in step740 using the current width of the test rectangle D. A final comparisonof the height based on the tallest character that fits into testrectangle D versus the height of test rectangle C is performed in step745. If the height based on the tallest character that fits into testrectangle D is less than or equal to the height of test rectangle C,then method 700 proceeds to step 755 where the characters are placed atthe linespace in the cell. At this point, it should be recognized bythose skilled in the art that it is possible to perform another, if notseveral, iterations of test rectangle calculations to determine if thereis even a closer fit of a test rectangle in the cell line (for example,calculating test rectangles E and F). However, while more iterations maybe performed, the degree to which a closer fit is achieved decreasesdrastically as the iterations increase. This requires that oneimplementing this invention offset the minimal advances achieved byadditional iterations with the cost of computation time and resources.In addition, the complexity of implementing this method is alsodependent on the type of constraint used. For example, if the constraintis known in advance to be an increasing diagonal (i.e., a diagonalprogressing from the Northwest corner to the Southeast corner), thewidth of the test rectangle would be known immediately without the needfor several iterations.

[0076] Continuing with method 700, if in step 745 the height based onthe tallest character that fits into test rectangle D is greater thanthe height of test rectangle C, then an invalid result has occurred, andthe method 700 proceeds to advance to the next linespace within the cellin step 760. Under this condition, no characters are placed at thelinespace. All the characters used to calculate the four test rectanglesA-D remain undisplayed and will be saved to determine if they can bedisplayed in the cell line at the next linespace.

[0077] At step 755, the method 700 places the characters from the testrectangle at the linespace in the cell. A valid character set that fitsin the cell line at the line space without overlapping the constrainthas been determined and therefore can be displayed in the cell. Thisstep 755 is entered either from step 725 or step 745. If step 755 isentered from step 725, the characters that fit into test rectangle B aredisplayed at the linespace. If step 755 is entered after step 745, thecharacters that fit into test rectangle D are displayed at thelinespace.

[0078] At step 760, the method 700 advances to the next linespace in thecell. The next linespace is determined by moving down a verticaldistance equal to the height allocated for the characters for theprevious linespace. However, the vertical distance to advance to thenext linespace can be arbitrary. The smaller the vertical distance, themore densely packed the layout will be. Whereas the larger the verticaldistance, the less densely packed and less costly (in terms ofcomputation time) the layout will be.

[0079] Proceeding to step 762, the method 700 checks to see if there areadditional characters to display and available space in the displayarea, at the next linespace, for another test rectangle. If there aremore characters and available space, then the method 700 branches backto step 710 where it generates another test rectangle A. However in thisinstance, the test rectangle A is generated at the next linespace in thecell. Method 700 then proceeds to place the characters at the nextlinespace in the method just described above. Therefore, method 700continues to display characters around a constraint in a cell untileither there are no characters left or there is no display room left todisplay the characters.

[0080] If at step 762 there is not enough room for another testrectangle or no more characters exist to display, then the method 700continues to step 765 where it stops.

[0081] In summary, the present invention is directed towards generatinga divided cell in a table, capable of being edited. In one embodiment, adiagonal cell is generated by selecting one cell in the table andcreating a new cell to display over the selected cell. Both cellscontain a constraint that define an area where that cell cannot displaycharacters. The selected cell contains a triangular constraint, and thenew cell contains an opposing triangular constraint. The cells aredisplayed over top of each other, along with a diagonal, such that thedisplay area of one cell coincides with the constraint area of the othercell. The display shows a diagonal cell capable of accepting charactersand having the characteristics of other cells in the table.

[0082] To perform the object layout in a cell with a constraint, anembodiment of the present invention utilizes test rectangles tocalculate the height and width of the displayable area of the cell. Aninitial test rectangle is calculated using the full width of the celland the height based on the tallest character to be placed in it. Theinitial test rectangle is then modified by applying the constraint tothe initial test rectangle and removing all the sections of the initialtest rectangle that intersect the constraint. The resulting charactersthat fit in the modified test rectangle are presented in the display. Inone embodiment, another iteration of the test rectangle method isperformed if the characters that fit in the modified test rectangle havea smaller height than those that fit within the initial test rectangle.

[0083] Alternative embodiments will become apparent to those skilled inthe art to which the present invention pertains without departing fromits spirit and scope. Accordingly, the scope of the present invention isdescribed by the appended claims and is supported by the foregoingdescription.

What is claimed is:
 1. In a computer system having a display, a methodfor generating a divided cell in a table, comprising the steps of:selecting a first cell within the table; generating a second cell in thetable; applying a first constraint to the first cell such that objectsdisplayed in the first cell are bounded by the first cell and the firstconstraint; applying second constraint to the second cell such thatobjects displayed in the second cell are bounded by the second cell andthe second constraint; and generating the divided cell by overlappingthe bounded objects of the first cell and the bounded objects of thesecond cell.
 2. The method of claim 1, wherein the divided cell is adiagonal cell.
 3. The method of claim 2, wherein the first constraint isa triangular constraint and the second constraint is an opposingtriangular constraint.
 4. The method of claim 1 further comprising thestep of placing objects in the first cell and the second cell.
 5. Themethod of claim 4, wherein the objects contained in second cell arecapable of being formatted independently of the objects in the firstcell.
 6. The method of claim 4 further comprising the steps of: editingthe objects in the first cell; reapplying the first constraint to thefirst cell such that the edited objects displayed in the first cell arebounded by the first cell and the first constraint; and displaying thedivided cell by overlapping the bounded edited objects of the first celland the bounded objects of the second cell.
 7. The method of claim 4further comprising the steps of: editing the objects in the second cell;reapplying the second constraint to the second cell such that the editedobjects displayed in the second cell are bounded by the second cell andthe second constraint; and displaying the divided cell by overlappingthe bounded objects of the first cell and the bounded edited objects ofthe second cell.
 8. The method of claim 4 further comprising the stepsof: resizing the first cell such that all objects contained in the firstcell are displayed when the first constraint is applied to the firstcell; and resizing the second cell such that all objects contained inthe second cell are displayed when the second constraint is applied tothe second cell;
 9. In a computer system having a display, a method forgenerating a diagonal cell in a table, comprising the steps of:selecting a first cell in the table; selecting a direction of adiagonal; generating a second cell in the table, the second cell havingthe same formatting characteristics as the first cell; generating atriangular constraint for the first cell based on the selected diagonaldirection, wherein the first triangular constraint defines a triangulararea within the first cell; generating an opposing triangular constraintfor the second cell based on the selected diagonal direction, whereinthe second triangular constraint defines a triangular area within thesecond cell; placing objects in the first cell and the second cell;displaying objects in the area of the first cell bounded by the area ofthe edges of the first cell and the triangular constraint; displayingobjects in the area of the second cell bounded by the area of the edgesof the second cell and the opposing triangular constraint; andoverlapping the display of the first cell and the display of the secondcell to create the diagonal cell.
 10. The method of claim 9, wherein theobjects contained in second cell are capable of being formattedindependently of the objects in the first cell.
 11. The method of claim9 further comprising the steps of: editing the objects in the firstcell; reapplying the first constraint to the first cell such that theedited objects displayed in the first cell are bounded by the first celland the first constraint; and displaying the divided cell by overlappingthe bounded edited objects of the first cell and the bounded objects ofthe second cell.
 12. The method of claim 9 further comprising the stepsof: editing the objects in the second cell; reapplying the secondconstraint to the second cell such that the edited objects displayed inthe second cell are bounded by the second cell and the secondconstraint; and displaying the divided cell by overlapping the boundedobjects of the first cell and the bounded edited objects of the secondcell.
 13. The method of claim 9 further comprising the steps of:resizing the first cell such that all objects contained in the firstcell are displayed when the first constraint is applied to the firstcell; and resizing the second cell such that all objects contained inthe second cell are displayed when the second constraint is applied tothe second cell;
 14. The method of claim 9, wherein the triangularconstraint comprises two adjacent edges of the first cell and thediagonal.
 15. The method of claim 9, wherein the opposing triangularconstraint comprises two adjacent edges of the second cell and thediagonal.
 16. In a computer system having a display, a method fordisplaying objects contained in a cell of a table bounded by aconstraint, comprising the steps of: selecting a linespace within acell, wherein the linespace represents a location in the cell;generating a first test rectangle having the width equal to the width ofthe cell and a height based on the height of a first set characters;applying a constraint to the first test rectangle; modifying the firsttest rectangle by removing the area of the first test rectangle thatintersects the constraint; determining a second set of objects that willfit into the modified first test rectangle; displaying the second set ofobjects at the linespace of the cell; and advancing to the nextlinespace within the cell;
 17. The method of claim 16, wherein the stepsof displaying the second set of objects at the linespace comprises: inthe event that the height based on the second set of objects is lessthan the height of the first test rectangle, then generating a secondtest rectangle having the width equal to the width of the cell and theheight based on the height of the second set of characters, modifyingthe second test rectangle by removing the area of the second testrectangle that intersects the constraint, determining a third set ofobjects that will fit into the modified second test rectangle; and inthe event that the height of the third set of objects is less than orequal to the height of the modified test rectangle, displaying thesecond set of objects at the linespace in the cell.
 18. The method ofclaim 16, wherein the constraint is a triangular constraint comprisingtwo adjacent edges of the cell and a diagonal.
 19. In a computer systemhaving a display, a method for displaying objects in a diagonal cell ina table, comprising the steps of: selecting a first cell in the table;generating a second cell in the table; placing objects in the first celland the second cell; applying a triangular constraint to the first celland an opposing triangular constraint to the second cell; generating afirst test rectangle representing a first set of objects in a line ofthe first cell that do not overlap the triangular constraint; generatinga second test rectangle representing a second set of objects in a lineof the second cell that do not overlap the opposing triangularconstraint; and overlapping the display of the objects represented bythe first test rectangle in the line of the first cell with the displayof the objects represented by the second test rectangle in the line ofthe second cell.
 20. The method of claim 19, wherein the step ofgenerating a first test rectangle comprises the steps of: generating afirst test rectangle having the width equal to the width of the firstcell and a height based on a height of a first subset of characters;generating a modified first test rectangle by removing the area of thefirst test rectangle that intersects the triangular constraint; anddetermining a second subset of objects that will fit into the modifiedtest rectangle;
 21. The method of claim 20 further comprising the stepsof: in the event the height of the second subset of objects is less thanthe height of the first test rectangle, generating a third testrectangle having the width equal to the width of the first cell and theheight based on the height of the second subset of characters,generating a modified third test rectangle by removing the area of thefirst test rectangle that intersects the triangular constraint,determining a third subset of objects that will fit into the modifiedthird test rectangle; in the event that the height of the third subsetof objects is greater than the height of the modified third testrectangle, advancing to the next linespace without placing any objectsin the line of the first cell; and in the event that the height of thethird subset of objects is less than or equal to the height of themodified third test rectangle, placing the third subset of objectsrepresented by the modified third test rectangle in the line of thefirst cell.
 22. The method of claim 19, wherein the step of generating asecond test rectangle comprises the steps of: generating a second testrectangle having the width equal to the width of the second cell and aheight based on a height of a first subset of characters; generating amodified second test rectangle by removing the area of the second testrectangle that intersects the opposing triangular constraint; anddetermining a second subset of objects that will fit into the modifiedtest rectangle;
 23. The method of claim 22 further comprising the stepsof: in the event the height of the second subset of objects is less thanthe second test rectangle, generating a third test rectangle having thewidth equal to the width of the first cell and the height based on theheight of the second subset of characters, generating a modified thirdtest rectangle by removing the area of the second test rectangle thatintersects the opposing triangular constraint, determining a thirdsubset of objects that will fit into the modified third test rectangle;in the event that the height of the third subset of objects is greaterthan the height of the modified third test rectangle, advancing to thenext linespace without displaying any objects in the line of the secondcell; and in the event that the height of the third set of objects isless than or equal to the height of the modified test rectangle, placingthe third subset of objects represented by the modified third testrectangle in the line of the second cell.
 24. The method of claim 19further comprising the steps of: editing the objects contained withinthe first cell; and modifying the first test rectangle based on theedited objects contained within the first cell.
 25. The method of claim19 further comprising the steps of: editing the objects contained withinthe second cell; and modifying the second test rectangle based on theedited objects contained within the second cell.
 26. The method of claim19 further comprising the steps of: resizing the first cell such thatall objects contained in the first cell are displayed when thetriangular constraint is applied to the first cell; and resizing thesecond cell such that all objects contained in the second cell aredisplayed when the opposing triangular constraint is applied to thesecond cell.
 27. The method of claim 19, wherein the triangularconstraint comprises two adjacent edges of the first cell and adiagonal.
 28. The method of claim 19, wherein the opposing triangularconstraint comprises two adjacent edges of the second cell and adiagonal.
 29. The method of claim 19, wherein the objects contained insecond cell are capable of being formatted independently of the objectsin the first cell.